﻿@model FCNS.ERP.Models.ErpUnit

@{
    ViewBag.Title = ViewData["Flag"]+" - 新增";
    Layout = "~/Views/Shared/_Layout.cshtml";;
}

<h2>@ViewBag.Title</h2>
<script type="text/javascript">
    $(document).ready(function () {
        $("#UnitFlag").val($("#Flag").val());
    });
</script>

@using (Html.BeginForm()) 
{
    @Html.AntiForgeryToken()
    
<div class="form-horizontal">
    <hr />
    @Html.ValidationSummary(true, "", new { @class = "text-danger" })
    @Html.Hidden("Flag", (int)ViewData["Flag"])
    @Html.HiddenFor(model => model.UnitFlag)
    <div class="form-group">
        @Html.LabelFor(model => model.Enable, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            <div class="checkbox">
                @Html.CheckBoxFor(model => model.Enable, htmlAttributes: new { @checked = "checked" })
                @Html.ValidationMessageFor(model => model.Enable, "", new { @class = "text-danger" })
            </div>
        </div>
    </div>

    <div class="form-group">
        @Html.LabelFor(model => model.Name, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.EditorFor(model => model.Name, new { htmlAttributes = new { @class = "form-control" } })
            @Html.ValidationMessageFor(model => model.Name, "", new { @class = "text-danger" })
        </div>
    </div>


    <div class="form-group">
        <div class="col-md-offset-2 col-md-10">
            <input type="submit" value="新增" class="btn btn-default" />
        </div>
    </div>
</div>
}

<div>
    @{
        var f = (int)ViewData["Flag"];
    }
    <a class="backToListImg" href="/Basic/Unit?flag=@f">返回</a>
</div>
 